home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pru_whirlpool.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  87 lines

  1. # Jones 3D Cog Script
  2. #
  3. # PRU_whirlpool.cog
  4. #
  5. # Whirlpool
  6. #
  7. # [SXC] [GGJ]
  8. #
  9. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11. symbols
  12.  
  13. message    startup
  14. message    entered
  15. message    arrived
  16. message pulse
  17.  
  18. sector    whirlpooltrigger
  19. sector    whirlpool
  20.  
  21. vector    suck
  22.  
  23. thing    player                        local
  24. thing    block
  25. thing    whirlpoolghost0
  26. thing    whirlpoolghost1
  27.  
  28. template    bubbleparticles0=whirlpoola        local
  29. template    bubbleparticles1=whirlpoolb        local
  30.  
  31. sound            drain=shs_h2odrain_c.wav        local
  32.  
  33. int        once=0    local
  34. int        draining    local
  35.  
  36. thing        whirlpool0        local
  37. thing        whirlpool1        local
  38.  
  39. flex    swirlrate=0.1
  40.  
  41. end
  42. # ========================================================================================
  43. code
  44. startup:
  45.     player = GetLocalPlayerThing();
  46.     return;
  47.     
  48. entered:
  49.     if (GetSenderRef() == whirlpooltrigger) 
  50.     {
  51.         if ((GetSourceRef() == player) && (once == 0))
  52.         {
  53.             Print("turning on Whirlpool from Entered message");
  54.             once=1;
  55.             SetPulse(swirlrate);
  56.             draining=PlaySoundThing(drain, whirlpoolghost0, 0.75, 4.0, 20.0, 0x1);
  57.             return;
  58.         }
  59.     }
  60. #whirlpool should suck less on easier difficulties (max 0.3, min 0.2)
  61. if (GetSourceRef() == whirlpool)
  62. {
  63.     SetSectorThrust(whirlpool, suck, (0.3 - ((5 - GetDifficulty()) * .02)));
  64.     return;
  65. }
  66.     
  67. return;
  68. # ========================================================================================
  69. pulse:
  70.  
  71.     whirlpool0 = CreateThing(bubbleparticles0, whirlpoolghost0);
  72.     whirlpool1 = CreateThing(bubbleparticles1, whirlpoolghost1);
  73.  
  74.     return;
  75.     
  76. arrived:
  77.     if ((GetSenderRef() == block) && (GetCurFrame(block) == 2))
  78.     {
  79.         Print("turning off whirlpool because block arrived at frame 2");
  80.         SetPulse(0.0);
  81.         StopSound(draining, 0.1);
  82.         Print("stopping drain sound");
  83.     }
  84.     return;
  85.  
  86. end
  87.